package com.rran.study.pf4j.config;

import org.pf4j.ExtensionFactory;
import org.pf4j.spring.SingletonSpringExtensionFactory;
import org.pf4j.spring.SpringPluginManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author shiyu
 * @title: SpringConfiguration
 * @projectName orchestrator-parent
 * @description: TODO
 * @date 2020/12/95:11 下午
 */
@Configuration
public class PluginSpringConfiguration {

    @Bean
    public SpringPluginManager pluginManager() {
        return new SpringPluginManager() {
            @Override
            protected ExtensionFactory createExtensionFactory() {
                // pluginManager 同上
                return new SingletonSpringExtensionFactory(this);
            }
        };
    }
}
